<template>
  <div class="home-page">
    <van-tabs>
      <van-tab v-for="item in list" :title="item.name" :key="item.id">
        {{ item.name }}
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  name: 'HomePage',
  data () {
    return {
      list: []
    }
  },
  async created () {
    const res = await axios.get('http://toutiao.itheima.net/v1_0/channels')
    console.log(res.data.data.channels)
    this.list = res.data.data.channels
  }
}
</script>

<style lang="less" scoped>
</style>
